package com.twu.biblioteca.view.consoleUI.viewActions;

import com.twu.biblioteca.view.ViewAction;

import java.io.PrintStream;

public class ReturnViewAction implements ViewAction {

    private final PrintStream output;
    private final String type;

    public ReturnViewAction(PrintStream output, Class itemType) {
        this.output = output;
        type = itemType.getSimpleName();
    }

    @Override
    public void update(boolean success) {
        if (success)
            output.println("Thank You for Returning the " + type + ".");
        else
            output.println("That is Not a Valid " + type + " to Return.");
    }
}
